// 第1步：导入创建ref对象的方法
import React, { Component, } from 'react';
import Show from './components/show/show'
import Login from './components/list/login'
class App extends Component {

  // 第2步：在构造方法中去得到ref对象
  // constructor(props) {
  //   super(props);
  //   this.usernameInputDom = createRef()
  // }
addForm(data){
  // 初始化一个数据源
  let form = []
  // 判断localStorage中是否有form字段
  if(localStorage.getItem('form')){
    form = JSON.parse(localStorage.getItem('form'))
  }
  form = [...form,data]
  localStorage.setItem('form',JSON.stringify(form))
}


  render() {
    return (
      <div> 
        <Login />
        <Show/>
      </div>
    );
  }
}

export default App;
